Prevent display from occurring twice in a row
authorJustin Burkett <justin@burkett.cc>
Mon, 5 Dec 2016 19:09:36 +0000 (14:09 -0500)
committerJustin Burkett <justin@burkett.cc>
Mon, 5 Dec 2016 19:29:22 +0000 (14:29 -0500)
Found some cases where this could happen with a secondary idle delay.

which-key.el

index 84beedace6b964ea7609e967974894d48e1aa224..c8a08295c5f6caa90581d350827db3eb49fa6443 100644 (file)
@@ -2171,12 +2171,13 @@ Finally, show the buffer."
                          (bound-and-true-p god-local-mode)
                          (eq this-command 'god-mode-self-insert))
                     (null this-command)))
-           (when (or (null which-key-delay-functions)
-                     (null (setq delay-time (run-hook-with-args-until-success
-                                             'which-key-delay-functions
-                                             (key-description prefix-keys)
-                                             (length prefix-keys))))
-                     (sit-for delay-time))
+           (when (and (not (equal prefix-keys which-key--current-prefix))
+                      (or (null which-key-delay-functions)
+                          (null (setq delay-time (run-hook-with-args-until-success
+                                                  'which-key-delay-functions
+                                                  (key-description prefix-keys)
+                                                  (length prefix-keys))))
+                          (sit-for delay-time)))
              (which-key--create-buffer-and-show prefix-keys)
              (when (and which-key-idle-secondary-delay
                         (not which-key--secondary-timer-active))